<?php
namespace Tbf\Bundle\DatabaseBundle\ListQuery;
class OrderExpress
{
    const ASC='asc';   //从小到大
    const DESC='desc'; //从大到小
    protected $field;
    protected $direction;
    public function setDirection($direction)
    {
        $this->direction = $direction;
    }

    public function getDirection()
    {
        return $this->direction;
    }

    public function getReverseDirection(){
        if ($this->direction===self::ASC){
            return self::DESC;
        }else{
            return self::ASC;
        }
    }

    public function setField($field)
    {
        $this->field = $field;
    }

    public function getField()
    {
        return $this->field;
    }
}
